//
//  YCTranslatorUTF8_16ToChinese.m
//  XTranslator
//
//  Created by 唐可雄 on 17/2/18.
//  Copyright © 2017年 swustyc. All rights reserved.
//

#import "YCTranslatorUTF8_16ToChinese.h"

@implementation YCTranslatorUTF8_16ToChinese

- (NSString *)strFrom:(NSString *)source {
    NSUInteger length = [source length];
    for (int i = 0; i < length; i++) {
        printf("%c", [source characterAtIndex:i]);
    }
    NSString *str = [[source stringByReplacingOccurrencesOfString:@"\\x" withString:@"%"] uppercaseString];
    
    str = [str substringToIndex:((int)(str.length/9))*9];
    
    str = [str stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
    return str;
}

@end
